package com.szh.model;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * model实体类的超类，抽取所有实体类的公共属性
 *
 * @author: SongZiHao
 * @date: 2023/5/10
 */
@Data
@ApiModel(description = "公共实体")
public class BaseEntity {

    @ApiModelProperty(value = "主键id")
    @TableId(type = IdType.AUTO) //维持主键自增
    private Long id;

    @ApiModelProperty(value = "逻辑删除字段")
    @TableLogic //逻辑删除标识注解
    @TableField("is_deleted")
    private Integer isDeleted;

    @ApiModelProperty(value = "创建时间")
    @TableField("create_time")
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    @TableField("update_time")
    private Date updateTime;
}
